<?php
namespace app\api\controller\zfshop;
class Userlevelconfig extends Base
{

    public function __construct() {
        parent::__construct();
    }

    public function lists(){
        $list = $this->db->query("select * from user_level_config");
        $data = [];
        foreach ($list as $k => $v) {
            $list[$k]['h5_url'] = url('h5/userlevelconfig',['id'=>$v['id']]);
            if ($this->userinfo && $this->userinfo['level']<$v['level']) {
                $v['h5_url'] = url('h5/userlevelconfig',['id'=>$v['id']]);
                $data[] = $v;
            }
        }
        if (!$this->userinfo) $data = $list;
        suc($data);
    }

}
